﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charSet="utf-8" />
    <meta charSet="utf-8" />
    <title>@ViewBag.webFrontTitle</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    <meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width" />
    @*    <link rel="shortcut icon" type="image/png" href="/login/images/RLCNavLogo.png" />
        <link rel="apple-touch-icon" href="/login/images/RLCNavLogo.png" />*@
    <style>
        body {
            background-color: black !important;
            background-repeat: no-repeat;
            background-position: center;
            background-size: cover;
            background-attachment: fixed;
            min-height: 100vh;
        }
    </style>
    <meta name="next-head-count" content="8" />
    <link href="~/layuiadmin/layui/css/layui.css" rel="stylesheet" />
    <link href="~/layuiadmin/style/admin.css" rel="stylesheet" />
    <link rel="stylesheet" href="/login/css/44706341c222index.css" data-n-g="" />
    <link rel="stylesheet" href="/login/css/4ee5d36c975376a7.css" data-n-g="" />
    <link rel="stylesheet" href="/login/css/1e43bb8010689ea2.css" data-n-p="" />
    <script type="text/javascript" src="~/js/CommonHelper.js"></script>
    <link href="~/css/user.css" rel="stylesheet" />
    <script>
        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }
    </script>
</head>
<body>
    <div id="__next" data-reactroot="">
        <div class="navbar_topBar__OcrDw MuiBox-root css-14sf2vu">
            <div class="MuiGrid-root MuiGrid-container css-705sxp">
                <div class="navbar_mobileLogo__2Cwp_ MuiBox-root css-0">
                    <a class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1wh44oh">
                        <img class="navbar_logo__8VQNO" src="@ViewBag.logo" alt="logo" />
                    </a>
                </div>
            </div>
            <div class="MuiCollapse-root MuiCollapse-vertical MuiCollapse-hidden css-a0y2e3" style="min-height:0px">
                <div class="MuiCollapse-wrapper MuiCollapse-vertical css-hboir5">
                </div>
            </div>
        </div>
        <div class="MuiBox-root css-8p6k1x">
            <div class="navbar_userStatus___mfCv MuiBox-root css-0">
                <div class="MuiContainer-root MuiContainer-maxWidthLg css-1qsxih2">
                    <div class="MuiBox-root css-0">
                        <div class="MuiGrid-root MuiGrid-container css-1n2dxyj">
                            <div class="MuiGrid-root MuiGrid-item MuiGrid-grid-md-2 css-pooakw">
                                <a class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1wh44oh">
                                    <img class="navbar_logo__8VQNO" src="@ViewBag.logo" alt="logo" />
                                </a>
                            </div>
                            <div class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-10 css-ncpj2v">
                                <p class="MuiTypography-root MuiTypography-body1 css-qn27t2">
                                    @*<button class="layui-btn demo-dropdown-base" id="languageSelect">
                                        <span><i class="layui-icon layui-icon-website"></i></span>
                                        </button>*@
                                    <button class="layui-icon layui-icon-website layui-btn-primary demo-dropdown-base languageSelect" id="languageSelect">
                                        <span id="lang">中文</span>
                                    </button>
                                </p>
                                <div class="MuiBox-root css-kr20jd"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="MuiBox-root css-rykaja"></div>
        <div class="MuiContainer-root MuiContainer-maxWidthMd MuiContainer-disableGutters css-1iu2d06">
            <div class="MuiGrid-root MuiGrid-container css-gqp7yh">
                <div class="MuiGrid-root MuiGrid-item MuiGrid-grid-sm-5 MuiGrid-grid-md-4 css-tj3wfj">
                    <div class="MuiBox-root css-0">
                        <h3 class="MuiTypography-root MuiTypography-h3 css-fvw74r">@ViewBag.sitename</h3>
                        <h4 class="MuiTypography-root MuiTypography-h4 css-jmr64r" id="transactionsSimpler" lay-event="transactionsSimpler">投资交易简单点</h4>
                        <h6 class="MuiTypography-root MuiTypography-subtitle1 css-5kgbfa">
                            ＞<span id="multipleVarieties">多品种，供您随心交易</span>
                        </h6>
                        <h6 class="MuiTypography-root MuiTypography-subtitle1 css-2rim5y">
                            ＞<span id="authoritative">权威平台，值得信赖</span>
                        </h6>
                        <h6 class="MuiTypography-root MuiTypography-subtitle1 css-2rim5y">
                            ＞<span id="convenientTransaction">为您提供最便捷的交易方式</span>
                        </h6>
                        <p class="MuiTypography-root MuiTypography-body1 css-1ly96oh">
                            <span id="join">加入</span>
                            <!-- -->@ViewBag.sitename
                            <!-- --><span id="startTrading">开始您的交易之旅</span>
                        </p>
                    </div>
                </div>
                <div class="MuiGrid-root MuiGrid-item MuiGrid-grid-xs-12 MuiGrid-grid-sm-7 MuiGrid-grid-md-6 css-y6k0lj">
                    <h2 class="MuiTypography-root MuiTypography-h2 css-yssjga" id="login" lay-event="="login">登录</h2>
                    <div class="MuiTabPanel-root css-13ekm19" role="tabpanel" index="1">
                        <h6 class="MuiTypography-root MuiTypography-subtitle1 css-2rim5y">
                            <span id="noAccount">没有真实账户？</span><a class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1wh44oh" id="register" lay-event="register">注册帐号</a>
                        </h6>
                    </div>
                    <div class="MuiTabPanel-root css-13ekm19" hidden="" role="tabpanel" index="2"></div>
                    <form class="MuiBox-root css-1sf3xto">
                        <p></p>
                        <label class="MuiInputLabel-root MuiInputLabel-animated MuiFormLabel-root MuiFormLabel-colorPrimary css-uh7t74" id="emailTitle" lay-event="emailTitle">电子邮箱</label>
                        <div class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-wjv17x">
                            <div class="MuiInput-root MuiInput-underline MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl css-sfnatb">
                                <input type="text" aria-invalid="false" name="email" id="email" placeholder="email" class="MuiInput-input MuiInputBase-input css-mnn31" />
                            </div>
                        </div>
                        <p></p>
                        <label class="MuiInputLabel-root MuiInputLabel-animated MuiFormLabel-root MuiFormLabel-colorPrimary css-uh7t74" id="userPwdTitle">密码</label>
                        <div class="MuiFormControl-root MuiFormControl-fullWidth MuiTextField-root css-wjv17x">
                            <div class="MuiInput-root MuiInput-underline MuiInputBase-root MuiInputBase-colorPrimary MuiInputBase-fullWidth MuiInputBase-formControl MuiInputBase-adornedEnd css-sfnatb">
                                <input type="password" aria-invalid="false" name="userPwd" id="userPwd" placeholder="userPwd" class="MuiInput-input MuiInputBase-input MuiInputBase-inputAdornedEnd css-mnn31" />
                                <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" id="showPwd">
                                    <path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"></path>
                                </svg>
                                <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" style="display:none;" id="hidePwd">
                                    <path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"></path>
                                </svg>
                            </div>
                        </div>
                        <div class="MuiGrid-root MuiGrid-container css-aodor1">
                            @*  <div class="MuiGrid-root MuiGrid-item css-g7ht58">
                                <label class="MuiFormControlLabel-root MuiFormControlLabel-labelPlacementEnd css-1jaw3da">
                                <span class="MuiCheckbox-root MuiCheckbox-colorPrimary MuiButtonBase-root MuiCheckbox-root MuiCheckbox-colorPrimary PrivateSwitchBase-root css-1va0n6a">
                                <input type="checkbox" class="PrivateSwitchBase-input css-1m9pwf3" data-indeterminate="false" />
                                <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-vubbuv" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="CheckBoxOutlineBlankIcon">
                                <path d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"></path>
                                </svg>
                                </span>
                                <span class="MuiTypography-root MuiTypography-body1 MuiFormControlLabel-label css-cylbv6" id="remember">记住密码</span>
                                </label>
                                </div>*@
                            <div class="MuiGrid-root MuiGrid-item css-1wxaqej">
                                <a class="MuiTypography-root MuiTypography-inherit MuiLink-root MuiLink-underlineAlways css-1wh44oh" href="forgot-password.html" id="forget">忘记密码</a>
                            </div>
                        </div>
                        <button class="MuiButton-root MuiButton-contained MuiButton-containedPrimary MuiButton-sizeMedium MuiButton-containedSizeMedium MuiButton-fullWidth MuiButtonBase-root Mui-disabled  css-874mvq" tabindex="-1" id="loginButtonText">登入</button>
                    </form>
                 @*   <p class="MuiTypography-root MuiTypography-body2 css-qmopxs">
                        <svg class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium css-ba7r0k" focusable="false" aria-hidden="true" viewBox="0 0 24 24" data-testid="LockIcon">
                            <path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"></path>
                        </svg>
                        <span>@Html.Raw(ViewBag.loginWarmPrompt)</span>
                    </p>*@
                     <p class="MuiTypography-root MuiTypography-body1 css-7qk4zw">@Html.Raw(ViewBag.loginWarmPrompt)</p>
                </div>
            </div>
        </div>
    </div>
    <script src="~/layuiadmin/layui/layui.js"></script>
    <script>
        layui.config({
            base: '../../layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'user', 'dropdown'], function () {
            var $ = layui.$
                , form = layui.form
                , dropdown = layui.dropdown
                , router = layui.router();
            form.render();
            document.onkeydown = function (e) {
                var ev = document.all ? window.event : e;
                if (ev.keyCode == 13) {
                    $('#login-submit').trigger("click");
                    return false;
                }
            }


            //多语言下拉框
            dropdown.render({
                elem: '#languageSelect', // 绑定元素选择器，此处指向 class 可同时绑定多个元素
                data: [{
                    title: '中文',
                    id: 'user-zh-CN',
                    href: '?language=user-zh-CN'
                }, {
                    title: 'English',
                    id: 'user-en-US',
                    href: '?language=user-en-US'
                }],
                click: function (obj) {
                    var selectedValue = $(this).val();
                    getLanguages(layui, selectedValue);
                    $('#forget').attr('href', '/Login/Forget?language=' + language)
                    $('#register').attr('href', '/Login/Register?language=' + language)
                }
            });

            /**获取语言 */
            var language = getUrlParam("language");
            if (language) {
                $("#languageSelect").val(language);
            }
            if (language === 'user-zh-CN') {
                $('#lang').text('中文')
            }
            else if (language === 'user-en-US') {
                $('#lang').text('English')
            }
            /**获取语言 End*/

            $('#showPwd').click(function () {
                $('#hidePwd').show()
                $('#showPwd').hide()
                $("#userPwd").attr("type", "text");
            })

            $('#hidePwd').click(function () {
                $('#hidePwd').hide()
                $('#showPwd').show()
                $("#userPwd").attr("type", "password");
            })

            $('#email').keyup(function () {
                var email = $('#email').val();
                var userPwd = $('#userPwd').val();
                //if (email == '') {
                //    top.ShowMessageByKey(layui, "emailNull", 0, 1000);
                //    return;
                //}
                if (email != '' && userPwd != '') {
                    $('#loginButtonText').removeClass('Mui-disabled');
                }
                else {
                    $('#loginButtonText').addClass('Mui-disabled');
                }
            })

            $('#userPwd').keyup(function () {
                var email = $('#email').val();
                var userPwd = $('#userPwd').val();
                //if (userPwd == '') {
                //    top.ShowMessageByKey(layui, "passwordNull", 0, 1000);
                //    return;
                //}
                if (email != '' && userPwd != '') {
                    $('#loginButtonText').removeClass('Mui-disabled');
                }
                else {
                    $('#loginButtonText').addClass('Mui-disabled');
                }
            })

            //提交
            $('#loginButtonText').click(function (obj) {
                var postData = {
                    "email": $('#email').val(),
                    "userPwd": $('#userPwd').val()
                };
                //请求登入接口
                $.ajax({
                    type: "POST",
                    url: "/Login/Login",
                    data: postData, // 你的formid
                    error: function (request) {
                        console.log("请求超时");
                    },
                    success: function (res) {
                        if (res.code == 0) {
                            top.ShowMessageByKey(layui, res.msg, 6, 1000, function () {
                                if (language) {
                                    window.location.href = '/Home/Index?language=' + language;
                                } else {
                                    window.location.href = '/Home/Index?language=user-zh-CN'
                                }
                            });
                        } else {
                            top.ShowMessageByKey(layui, res.msg, 0, 1000);
                        }
                    }
                });
                return false;
            });

            var language = getUrlParam("language");
            $(document).ready(function () {
                if (language) {
                    getLanguages(layui, language);
                    $('#forget').attr('href', '/Login/Forget?language=' + language)
                    $('#register').attr('href', '/Login/Register?language=' + language)
                } else {
                    getLanguages(layui, 'user-zh-CN');
                    $('#forget').attr('href', '/Login/Forget?language=user-zh-CN')
                    $('#register').attr('href', '/Login/Register?language=user-zh-CN')
                }
            });
        });
    </script>
</body>
</html>